<h1>Home Page</h1>
<hr/>
<h2>Food List</h2>
<jsp:include page="data?view=food&action=list" />
<jsp:include page="data?view=menu&action=list" />
<c:if test="${not empty requestScope.foods}">
    <table cellpadding="5" cellspacing="5">
        <tbody>
            <tr>
                <th>Name</th>
                <th>Price</th>
                <th>Description</th>
            </tr>
        <c:forEach items="${requestScope.foods}" var="food">
            <tr>
                <td>${food.name}</td>
                <td>$${food.price}</td>
                <td>${food.description}</td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</c:if>
<hr/>
<h2>Menu</h2>
<c:if test="${not empty requestScope.menus}">
    <table cellpadding="5" cellspacing="5">
        <tbody>
            <tr>
                <th>Name</th>
                <th>Description</th>
                <th>List Food</th>
            </tr>
        <c:forEach items="${requestScope.menus}" var="menu">
            <tr>
                <td>${menu.name}</td>
                <td>${menu.description}</td>
                <td>

            <c:if test="${empty menu.foods}">
                No food in menu
            </c:if>
            <c:if test="${not empty menu.foods}">
                <ul>
                    <c:forEach items="${menu.foods}" var="foodMenu">
                        <li>${foodMenu.name} (Price: $${foodMenu.price})</li>
                    </c:forEach>
                </ul>
            </c:if>
            </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</c:if>

